<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{log_name} : {log_account_no}</title>
<link rel="shortcut icon" href="{dir_image}favicon.ico">
<link rel="stylesheet" type="text/css" href="{dir_css}Global.css" />
<link rel="stylesheet" type="text/css" href="{dir_css}Popup.css" />
<link rel="stylesheet" type="text/css" href="{dir_css}Student.css" />

<script type="text/javascript" src="{dir_js}jquery.min.js"></script>
<script type="text/javascript" src="{dir_js}Global.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		courseDept();
		
		if ( $('#txtaccountno').val() == '' ) {
			accountNo('');
		}
		
	});
	
	function accountNo(strAccount) {
		
		var m = $('#m').val();
		var d = $('#d').val();
		var y = $('#y').val();
		var h = $('#h').val();
		var i = $('#i').val();
		
		$('#txtaccountno').val('S' + y + '' + m + d + '-' + h +  i);
			
	}

	function courseDept() {
		
		var courseID = $('#txtcourse').val();
		var departmentID = $('#txtdepartment option:selected').val();
		var course_popup_div = $('#course_popup_div');
		$.post('request.php', {AJAXPost:'courseDepartment', strDepartmentID:departmentID}, function(res) {
			
			$.each( res, function( key, value ) {
				
				if ( value['course_idPK'] == courseID ) {
					var courseActive = ' checked="checked"';
				}
				else {
					var courseActive = '';
				}
				
				course_popup_div.append('<div><label for="course_radio' + value['course_idPK'] + '"  id="co_requisite_label">'+
											'<input type="radio" id="course_radio' + value['course_idPK'] + '" value="' + value['course_idPK'] + '" name="course_radio" onclick="courseValue(\'' + value['course_idPK'] + '\')" ' + courseActive + '/> ' + value['course_desc'] + ' (' + value['course_code'] +')'+
										'</label></div>');
										
			});
			
		}, 'json');
	}
	
	function courseValue(courseID) {
		$('#txtcourse').val(courseID);
	}
</script>
</head>

<body>
<!-- POPUP -->{page_popup}<!-- POPUP END -->
<!-- TOP HEADER -->{page_header}<!-- TOP HEADER END -->
	<div class="main-content">
	
		<table width="0" border="0" cellspacing="0" cellpadding="0">
			<tr valign="top" align="left">
				<td width="220">
					{reg_sub_menu}
				</td>
				<td width="755">
					<div class="page-sub-content">
					<div class="float-right-back"><a href="?page=Students"><img src="{dir_image}icon/back.png" border="0"/></a></div>	
					<div class="ann-top-label">Students Registration</div>
					<input type="hidden" id="m" value="{m}"/>
					<input type="hidden" id="d" value="{d}"/>
					<input type="hidden" id="y" value="{y}"/>
					<input type="hidden" id="h" value="{h}"/>
					<input type="hidden" id="i" value="{i}"/>
					<form method="post" enctype="multipart/form-data" action="">
						<table width="750" border="0" cellspacing="0" cellpadding="0">
							<tr valign="top">
								<td width="88">Course Offered<span class="required-field">*</span></td>
								<td width="12">:</td>
								<td width="650">{department_list}
									<input type="hidden" name="txtcourse" id="txtcourse" value="{txtcourse}" /> <span class="required-field">{w_txtcourse}</span>
									<div class="course-popup" id="course_popup">
										<div id="course_popup_div"></div>
									</div>
								</td>
							</tr>
							<tr>
								<td height="8" colspan="3"></td>
							</tr>
							<tr>
								<td width="130" height="28">Student #</td>
								<td width="10">:</td>
								<td width="350"><input type="text" name="txtaccountno" id="txtaccountno" class="text-input" value="{txtaccountno}" /> <span class="required-field">{w_txtaccountno}</span></td>
							</tr>
							<tr>
								<td height="28">First Name<span class="required-field">*</span></td>
								<td>:</td>
								<td><input type="text" name="txtfname" class="text-input" value="{txtfname}"/> <span class="required-field">{w_txtfname}</span></td>
							</tr>
							<tr>
								<td height="28">Middle Name</td>
								<td>:</td>
								<td><input type="text" name="txtmname" class="text-input" value="{txtmname}"/></td>
							</tr>
							<tr>
								<td height="28">Last Name<span class="required-field">*</span></td>
								<td>:</td>
								<td><input type="text" name="txtlname" class="text-input" value="{txtlname}" /> <span class="required-field">{w_txtlname}</span></td>
							</tr>
							<tr>
								<td height="28">Birthdate</td>
								<td>:</td>
								<td>
								<select name="txtbdatemm" id="txtbdatemm" class="select-month-input">
									<option value="">--- Month ---</option>
									<option value="01" {selected01}>January</option>
									<option value="02" {selected02}>February</option>
									<option value="03" {selected03}>March</option>
									<option value="04" {selected04}>April</option>
									<option value="05" {selected05}>May</option>
									<option value="06" {selected06}>June</option>
									<option value="07" {selected07}>July</option>
									<option value="08" {selected08}>August</option>
									<option value="09" {selected09}>September</option>
									<option value="10" {selected10}>October</option>
									<option value="11" {selected11}>November</option>
									<option value="12" {selected12}>December</option>
								</select>
								<input type="text" class="select-day-input" name="txtbdatedd" id="txtbdatedd" value="{txtbdatedd}" maxlength="2" {w_txtbdatedd}/>
								<input type="text" class="select-year-input" name="txtbdateyy" id="txtbdateyy" value="{txtbdateyy}" maxlength="4" {w_txtbdateyy}/>
								 <span class="required-field">{w_txtbdate}</span>
								</td>
							</tr>
							<tr>
								<td height="28">Gender</td>
								<td>:</td>
								<td>
									<select name="txtgender" class="select-month-input">
										<option value="">--- Gender ---</option>
										<option value="male" {selectedmale}>Male</option>
										<option value="female" {selectedfemale}>Female</option>
									</select>
								</td>
							</tr>
							<tr>
								<td height="28">E-mail Addres</td>
								<td>:</td>
								<td><input type="text" name="txtemail" class="text-input" value="{txtemail}"/> <span class="required-field">{w_txtemail}</span></td>
							</tr>
							<tr>
								<td height="28">Contact #</td>
								<td>:</td>
								<td><input type="text" name="txtcontact" class="text-input" value="{txtcontact}"/></td>
							</tr>
							<tr>
								<td height="28">Home Address</td>
								<td>:</td>
								<td><input type="text" name="txtaddress" class="text-input" value="{txtaddress}"/></td>
							</tr>
							<tr>
								<td height="28">Guardian</td>
								<td>:</td>
								<td><input type="text" name="txtguardian" class="text-input" value="{txtguardian}"/></td>
							</tr>
							<tr>
								<td height="8" colspan="3"><span class="required-field">{udpate_user_pass}</span></td>
							</tr>
							<tr>
								<td height="28">Username<span class="required-field">*</span></td>
								<td>:</td>
								<td><input type="text" name="txtusername" class="text-input" value="{txtusername}"/> <span class="required-field">{w_txtusername}</span></td>
							</tr>
							<tr>
								<td height="28">Password<span class="required-field">*</span></td>
								<td>:</td>
								<td><input type="password" name="txtpassword" class="text-input" value=""/> <span class="required-field">{w_txtpassword}</span></td>
							</tr>
							<tr>
								<td height="28"></td>
								<td></td>
								<td><input type="submit" name="subButton" class="submit-input" value="Save"/> <span class="record-saved-color">{saved_record}</span></td>
							</tr>
						</table>
					</form>
					</div>
				</td>
			</tr>
		</table>
		
	</div>
<!-- FOOTER -->{page_footer}<!-- FOOTER -->
</body>
</html>
